import 'dart:convert';

/// @class : UserEntity
/// @date : 2021/08/23
/// @name : jhf
/// @description : 用户信息
class UserEntity {
  String phoneNumber = '';
  String customerId = '';
  String customerOpenId = '';
  String token = '';
  String nickName = '';
  String avatar = '';
  String userSig = '';
  String jobNumber = '';
  String idCard = '';

  UserEntity({
    required phoneNumber,
    required customerId,
    required token,
    required customerOpenId,
    required nickName,
    required avatar,
    required userSig,
    required jobNumber,
    required idCard,
  });

  UserEntity.fromJson(Map<dynamic, dynamic> json) {
    phoneNumber = json["phoneNumber"].toString();
    customerId = json["customerId"] ?? '';
    token = json["token"];
    customerOpenId = json["customerOpenId"] ?? '';
    nickName = json["nickName"] ?? '';
    avatar = json["avatar"] ?? '';
    userSig = json["userSig"] ?? '';
    jobNumber = json["jobNumber"] ?? '';
    idCard = json["idCard"] ?? '';
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data["phoneNumber"] = phoneNumber;
    data["token"] = token;
    data["customerId"] = customerId;
    data["customerOpenId"] = customerOpenId;
    data["nickName"] = nickName;
    data["avatar"] = avatar;
    data["userSig"] = userSig;
    data["jobNumber"] = jobNumber;
    data["idCard"] = idCard;

    return data;
  }
}
